/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package projecteuler;
import java.math.BigInteger;
/**
 *
 * @author ChunchO
 */
public class Problem012 {
	static int suma;
	public static void main(String[] args) {
		int i = 4;
		boolean done = false;
		while (!done){
			suma = (1+i)*i/2;
			i++;
			int cantidadDeDivisores = 0;
			int b = 1;
			while(b<=Math.sqrt(suma))
			{
				if(suma%b==0)
					cantidadDeDivisores+=2;
				b++;
			}
			if(cantidadDeDivisores >=100)
				System.out.println("numero: "+suma+" \tcantidad de divisores:"+cantidadDeDivisores);
			if(cantidadDeDivisores >=500)
				done = true;
		}
		System.out.println(suma);
	}
}
